package com.visiontech.volunteer_center.service.impl;

import com.visiontech.volunteer_center.mapper.ContentMapper;
import com.visiontech.volunteer_center.pojo.Content_LFRX;
import com.visiontech.volunteer_center.pojo.Content_WMSX;
import com.visiontech.volunteer_center.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ContentServiceImpl implements ContentService {

    @Autowired
    private ContentMapper contentMapper;

    @Override
    public List<Content_WMSX> showContent_wmsx() {
        return contentMapper.showContents_wmsx();
    }

    @Override
    public List<Content_WMSX> findByTitle_wmsx(String title) {
        return contentMapper.findByTitle_wmsx(title);
    }

    @Override
    public Integer deleteById_wmsx(Integer wmsx_id){return contentMapper.deleteById_wmsx(wmsx_id);}

    @Override
    public Integer updateById_wmsx(Integer wmsx_id, String title, String link, String photo){
        return contentMapper.updateById_wmsx(wmsx_id, title, link, photo);
    }

    @Override
    public Integer insertWMSX(String title, String link, String photo){
        return contentMapper.insertWMSX(title, link, photo);
    }

//  ===================================================================================================================

    @Override
    public Integer insertLFRX(String name, String sex,  String phone, String email, String address, String text) {
        return contentMapper.insertLFRX(name, sex, phone, email, address ,text);
    }

    @Override
    public List<Content_LFRX> showLFRXContent() {
        return contentMapper.showLFRXContents();
    }

    @Override
    public Content_LFRX findById(Integer lfrx_id) {
        return contentMapper.findById(lfrx_id);
    }

    @Override
    public List<Content_LFRX> findByName(String lfrx_name){return contentMapper.findByName(lfrx_name);}

    @Override
    public List<Content_LFRX> findLFRX(Integer lfrx_id, String lfrx_name){
        return contentMapper.findLFRX(lfrx_id, lfrx_name);
    }

    @Override
    public Integer deleteById_lfrx(Integer lfrx_id) {
        return contentMapper.deleteById_lfrx(lfrx_id);
    }
}
